/**
 * Description
 *
 * Creation Date 21/12/2017
 * @author Candy
 */
/**
 * 创建Store,整合Provider
 * @flow
 */
import thunk from 'redux-thunk';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import rootReducer from './../reducers/rootReducers';

// let store = createStore(rootReducer, {}, compose(
// 	applyMiddleware(thunk),
// 	window.devToolsExtension ? window.devToolsExtension() : f => f
// ))
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(combineReducers(rootReducer), /* preloadedState, */ composeEnhancers(
	applyMiddleware(thunk)
));

export default store;